﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynConDevCorp.OpenArch.SmartData.Interfaces
{
    /// <summary>
    /// Base Interface for all Rule classes which are not dependant on the Type of data involved in the 
    /// process
    /// </summary>
    /// <remarks>
    /// While the SmartData architecture does support the normal Event based approach, the usage of Rules provides
    /// a much greater degree of control. Most Event implementations are wrappers that create (or destroy) Rule instances
    /// internally, and as such do NOT provide any benefits other than a more a familiar syntax.
    /// </remarks>
    public interface ISmartRule
    {
    }

    /// <summary>
    /// Generic Base Interface for all Rule classes which are dependant on the Type of data involved in the 
    /// process
    /// </summary>
    /// <remarks>
    /// While the SmartData architecture does support the normal Event based approach, the usage of Rules provides
    /// a much greater degree of control. Most Event implementations are wrappers that create (or destroy) Rule instances
    /// internally, and as such do NOT provide any benefits other than a more a familiar syntax.
    /// </remarks>
    /// <typeparam name="TData">The type of the AT a_ TYPE.</typeparam>
    public interface ISmartRule<TData> : ISmartRule
    {
        /// <summary>
        /// Evaluates the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="proposedValue">The proposed value.</param>
        /// <returns></returns>
        bool Evaluate(ISmartField source, TData proposedValue);
    }
}
